﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace FeedReader.Shared.Data
{
    public static class Utils
    {
        public static string HashToBase64(string text)
        {
            int iter = 1000;
            SHA1CryptoServiceProvider SHA1 = new SHA1CryptoServiceProvider();
            byte[] byteValue = System.Text.Encoding.UTF8.GetBytes(text);
            do
            {
                byteValue = SHA1.ComputeHash(byteValue);
            } while (--iter > 0);
            SHA1.Clear();
            return Convert.ToBase64String(byteValue);
        }

        public struct QueueXMLMessage
        {
            public string UserID;
            public string Reference;
        }
    }
}
